//go:build !windows
// +build !windows

package gouciparser

import (
	"os"
	"os/exec"
	"path/filepath"
)

func cmdSysProcAttr(cmd *exec.Cmd) {} //

func fileChmod(name string) error {
	fi, err := os.Stat(name)
	if err != nil {
		return err
	}
	if ok := fi.IsDir(); ok {
		os.Chmod(name, 0766)
		fis, err := os.ReadDir(name)
		if err != nil {
			return err
		}
		for _, v := range fis {
			nname := filepath.Join(name, v.Name())
			fileChmod(nname)
		}
	} else {
		err = os.Chmod(name, 0766)
		if err != nil {
			return err
		}
	}
	return nil
}
